﻿/*              Copyright(c) 2008 Dave Sexton              *
 * http://www.codeplex.com/DocProject                      *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using DaveSexton.DocToMaml.Maml;

namespace DaveSexton.DocToMaml
{
	internal sealed class ConvertRule : Rule
	{
		#region Public Properties
		public MamlElementType Maml { get; set; }

		public override object Value
		{
			get
			{
				return Maml;
			}
			set
			{
				Maml = (MamlElementType) value;
			}
		}
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="ConvertRule" /> class.
		/// </summary>
		public ConvertRule(string match, RuleMatchKind matchKind, MamlElementType maml)
			: base(match, matchKind, RuleAction.Convert)
		{
			if (!Enum.IsDefined(typeof(MamlElementType), maml))
				throw new System.ComponentModel.InvalidEnumArgumentException("maml", (int) maml, typeof(MamlElementType));

			Maml = maml;
		}
		#endregion
	}
}
